﻿<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>专享服务使用记录</title>
<script type="text/javascript" src="../js/common.js"></script>
<link href="../css/Pager.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="../js/jquery.pager.js"></script>
<script type="text/javascript" src="../js/gbRst.js"></script>
<script type="text/javascript" src="../js/utils.js"></script>
<script type="text/javascript" src="../js/shop.js"></script>
<script type="text/javascript" src="../js/checkLogin.js"></script>
<script type="text/javascript" src="../js/shopSelecterNew.js"></script>
<script type="text/javascript" src="../js/find.js"></script>
<script type="text/javascript" src="../js/pagination.js"></script>
<script type="text/javascript" src="../js/memberLevelSelecterNew.js"></script> 
<script type="text/javascript" src="../js/doubleDate2.0.js"></script> 
<link href="../css/style.css" type="text/css" rel="stylesheet" />
<style type="text/css">
.moreData{width:100%;overflow-x:scroll;}
.member_list th{white-space:nowrap;}
</style>
<script type="text/javascript">
$(function(){
	$("#shopIsChoosed").click(function(){
		if($("#shopIsChoosed").is(":checked")){
			$("#shopName").attr("disabled",false);
			
		}else{
			$("#shopName").attr("disabled",true);
		}
	});
	$('#dtBegin').val(getToday());
	 $('#dtEnd').val(getToday());
	 refreshInput($(".serWrapper"));
		$('.doubledate').kuiDate({
			className:'doubledate',
			isDisabled: "0"  // isDisabled为可选参数，“0”表示今日之前不可选，“1”标志今日之前可选
		});
})

var pageIndex = 1
function search(index){
	if(IsNotEmpty(index)){
	pageIndex = index	
	}else{
		pageIndex = 1;
	}
	var mp=$("#mp").val().replace(/\s/gi,'');	
	var cardNo=$("#cardNo").val().replace(/\s/gi,'');
	var dtBegin=$("#dtBegin").val();
	var dtEnd=$("#dtEnd").val();
	var license=$("#license").val();
	var custName=$("#custName").val();
	var shopId="";
	var levelId = $("#memberLevelId").val();
	if(IsEmpty(levelId)){
		levelId = "";
	}
	if($("#shopIsChoosed").is(":checked")){		
		shopId=$("#shopName").val();
		if(IsEmpty(shopId)){
			shopId = "";
		}
	}
	
	var params = {'mp':mp,'cord':cardNo,'dtBegin':dtBegin,'dtEnd':dtEnd,'custName':custName,'shopId':shopId}
	
	var dt = _findInfo("../memberExclusiveServiceConsume/find/memberExclusiveServiceConsumeList/"+(pageIndex-1)+"/10", params)
	if(IsNotEmpty(dt)&&dt.state==0){
/* 		var p = new Array(cl","ls","FactAmt","FreeAmt","BankAmt","CashAmt","CashCouponAmt","DepositAmt","DepositAmt","VoucherAmt","VoucherMemo","VoucherAmt2","VoucherMemo2","FreeAmt");
		_loadInfo(dt, "memberList", p); */
		$("#memberList tbody").empty()
		$("#sup").html("共"+dt.result.len+"条")
		for(var i=0;i<dt.result.data.length;i++){
			var htm="<tr style=\"white-space: nowrap;\">"
				
				htm+="<td>"+_getSomeOfJson(i, dt, "createFileTime")+"</td>"
				htm+="<td>"+_getSomeOfJson(i, dt, "name")+"</td>"
				htm+="<td>"+_getSomeOfJson(i, dt, "CustomerName")+"</td>"
				htm+="<td>"+_getSomeOfJson(i, dt, "Mp")+"</td>"
				htm+="<td>"+_getSomeOfJson(i, dt, "MemberCardNo")+"</td>"
				htm+="<td>"+_getSomeOfJson(i, dt, "createFileMan")+"</td>"
				htm+="<td>"+"<input class='stampBtn common_btn' type='button' value='打印' onclick='toPrint("+ _getStringOfJson(i, dt, "id") +")'>"+"</td>"		
				htm+="</tr>"
				$("#memberList tbody").append(htm)
		}
		
		_loadPage("pager", pageIndex, 10, dt, search, "NoResult")
	}
	

}


function toPrint(id){
	window.open('printMemberServiceConsume.html?id='+id)

}

function toAdd(){

		var mp=$("#mp").val().replace(/\s/gi,'');	
		var cardNo=$("#cardNo").val().replace(/\s/gi,'');
		var dtBegin=$("#dtBegin").val();
		var dtEnd=$("#dtEnd").val();
		var license=$("#license").val();
		var custName=$("#custName").val();
		var shopId="";

		if($("#shopIsChoosed").is(":checked")){		
			shopId=$("#shopName").val();
			if(IsEmpty(shopId)){
				shopId = "";
			}
		}
		var params = {'mp':mp,'cord':cardNo,'dtBegin':dtBegin,'dtEnd':dtEnd,'custName':custName,'shopId':shopId,'downType':21}
		window.location.href="../csvdown/down/csv/down?"+$.param(params)
}

function getLevelId(){
	var shopId = $("#shopName").val();
	if(IsEmpty(shopId)){
		artError("请先选择店铺");
		return false;
	}
	openMemberLevelListPanel("memberLevelId",shopId)
}
</script>
</head>

<body>
<div class="container" id="container">
  <div class="container_R fr">
	<div class="place">延保清单</div>
	<div class="member_search">
      <p><span>
        <input type="checkbox" id="shopIsChoosed" style="width:auto;height:auto;border:none;">
        店面：</span>
        <select disabled="disabled" id="shopName" onclick="openShopListPanel(this)" style=";height:20px;">
        </select>
        <span>起始日期：</span>
        <input type="text" readonly class="doubledate ipticon"  id="dtBegin"/>
        <span>截止时间：</span>
        <input type="text" readonly class="doubledate ipticon" id="dtEnd"/>
      </p>
      <p>
      <span>姓名：</span>
        <input type="text" id="custName" class="absoluteTxt">
      <span>手机号：</span>
      <input type="text" id="mp" class="absoluteTxt">
        <span>会员卡号：</span>
        <input type="text" id="cardNo" class="absoluteTxt">
      </p>
      <p>
            <input type="button" value="查询" class="btn" onclick="search(1)">
      
      </p>
    </div>
	
<!--     <div class="moreData">
 -->    <table class="member_list"  width="100%" cellpadding="0" cellspacing="1" border="0" id="memberList">
    	<caption><strong>服务使用列表        <span id="sup">共0条</span></strong><input type="button" value="导出" class="common_btn addList" onclick="toAdd()"></caption>
    	<thead>
    	<tr style="white-space: nowrap;">
        	<th >使用时间</th>
        	<th >服务项目</th>
        	<th>姓名</th>
        	<th>电话</th>
        	<th>会员卡号</th>
        	<th>操作人</th>
        	<th>操作</th>
        </tr>
        </thead>
        <tbody></tbody>
    </table>
 <!--    </div>
 -->     <div id="sum" style="float: left;"></div>
    <div id="NoResult"  class="Nothing" style="text-align:center;display: none;">无符合条件的数据！</div>
    <div id="pager" style="float: right;"></div>
  </div>
  <div class="fc"></div>
</div>
<script type="text/javascript" src="../js/header.js"></script> 
<script type="text/javascript" src="../js/left.js"></script> 
<script type="text/javascript" src="../js/footer.js"></script> 
<script type="text/javascript">
addMargin($(".hideDiv"))
clearThis("absoluteTxt");
</script>
</body>
</html>
